home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / gold / eggMethods.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.1 KB  |  74 lines

  1. /*
  2.  * The original copyright owners of the accompanying source code files have
  3.  * agreed to place such code into the public domain.  Accordingly, anyone
  4.  * who receives or obtains a copy of such source code is freely entitled to
  5.  * reproduce, use and otherwise exploit such code (including the right to
  6.  * make derivative works), at his/her own risk and expense, without any
  7.  * obligation or liability to the original copyright owners.
  8.  *
  9.  * We would appreciate (but do not require) that the following message be
  10.  * included in any derivative works:
  11.  *
  12.  * "Portions of this program were developed by Peter Broadwell, Rob Myers
  13.  * and Robin Schaufler while working in Silicon Valley."
  14.  *
  15.  * The accompanying source code files and related documentation materials
  16.  * are distributed on an "AS IS" basis, without any warranties or
  17.  * guarantees of any kind.  All implied warranties, including the implied
  18.  * warranties of merchantability and of fitness for any particular purpose,
  19.  * are expressly disclaimed.
  20.  */
  21. #include <math.h>
  22. #include "gl.h"
  23. #include "device.h"
  24. #include "geom.h"
  25. #include "class.h"
  26. #include "classIds.h"
  27. #include "selectors.h"
  28. #include "mbox.h"
  29. #include "individual.h"
  30. #include "behavior.h"
  31. #include "doers.h"
  32. #include "colors.h"
  33.  
  34. extern individual *us;
  35. extern behavior expanderTemplate;
  36.  
  37. subscr *findvars();
  38.  
  39. #define PI 3.14159265358979323844
  40. #define DEG(x) ((float)x*(float)180/PI)
  41. #define RAD(x) ((float)x*PI/(float)180)
  42.  
  43.     /*
  44.      *  initialize an egg's drawing (swiped from bubbleinit)
  45.      */
  46. egginit(s)
  47.     register individual *s;
  48. {
  49.     register model *myModel;
  50.  
  51.     replicateModel(s);    /* first, instantiate and initialize the model */
  52.     myModel = s->descr;    /* use newly instantiated model */
  53.  
  54.     makeobj((Object)myModel);
  55.     backface(FALSE);
  56.     fishWritemask(FOREGROUND);
  57.     fishColor(myModel->color);
  58.     rotate(900,'z');
  59. #define WIMP
  60. #ifdef WIMP
  61.     rotate(900,'y');
  62. #endif /* WIMP */
  63.     /*****
  64.     rotate(900,'x');
  65.     /*****/
  66.     scale(-1.0, 1.0, -1.0);
  67.     circi(10,0,12);
  68.     circfi(7,4,2);
  69.     backface(TRUE);
  70.     closeobj();
  71.     myModel->compiled = TRUE;
  72.     myModel->component = (Object)myModel;
  73. }
  74.